fixed some compile time bugs