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