Issue #23: Added fix for upgrade error and added setType for form elements.