Bug fix in errors