Fixed error indicator. Cleaned up debugging