Fix indentation and use actual Error objects