Added DebugCommand and corrected a few simulator bugs.
Improved command error reporting.