Fixed some issues with sub-systems.  Removed many unused variables