Revert some changes for build in the source, and some small changes