fixing more error reporting bugs