Fixed error reporting