Fix post error-checking order