#307 fix compiler bugs