Made sure that the script shuts down gracefully
More options and tweaked options