Fixed issues affecting compilation to native code