fixed bad error reporting
fixed some more logging