Fix exceptions bugs in the build command.