Fixed problems in copying files to the build directory