Added some cmd line error handling