Fixed some compile time bugs