Added tests for system functions like shutdown

Added a few tests for bad line handling too.