Fixed compile errors (the nasty way)