fixed some error reporting issues