Fixed some code to be less compiler-dependent