Fixed a few bugs as well as working out kinks with shutdown command.
Added logging.