Added some checks for the build directory command-line argument.