Fixed i386 calling convention issue and CMake build on i386.