Finally fixed the compile issue. Tested on Mac (Maya 2014); will test on other platforms later.