Fixed problem with err return values, added in a bit more error checking with execv