Fix some errors for build