Throw a FormException if element creation fails
Fix imports