Fixed a few bugs that were preventing the system from operating properly