Error reporting
Debug output
Fixed silly bug