Reset Z when returning error