Fixed some bugs that occurred with refactoring.  Praise the sun.