Fixed a couple compilation problems, and changed the compatibilty