Added a check not to remove the build directory if it doesn't exist.