return exit status 1 when a command fails

+ add blank lines and remove duplicated imports