Fix copy errors and precompile issue