Bug Fixes

Fixes to refactoring continued...Taking a break, moving onto the GUI