Makes the native methods static, and a few fixes for building