Fixed several issues with the build procedure.