Maintain correct form state on error