--- Form-0.8alpha.py	2008-02-03 23:06:07.000000000 -0800
+++ Form.py	2008-02-29 10:15:20.000000000 -0800
@@ -130,7 +130,7 @@
                 field_type = field_data[1]
                 if record:
                     value = record[field_data[0]]
-                    if field_type not in self.datetime_types and field_type:
+                    if field_type not in self.datetime_types and field_type and callable(field_type):
                         value = field_type(value)
                 self.variables['%s.%s' % (form_key, field)] = value
            
@@ -238,7 +238,7 @@
             value = self.post_args.get(field_key, [u''])[index]
             form = self.forms[form_key]
             field_type = form['fields'][field_name][1]
-            if field_type:
+            if field_type and callable(field_type):
                 value = field_type(value)
         if value == '':
             value = None
@@ -406,6 +406,7 @@
         elif connection_type == 'mysql':
             import MySQLdb
             port = connection_dict.get('port', '3306').strip('`')
+            port = int(port)
             self.connection = MySQLdb.connect(host = self.get_stripped_from_connection_dict('server'), port = port, user = self.get_stripped_from_connection_dict('uid'), passwd = self.get_stripped_from_connection_dict('pwd'),db = self.get_stripped_from_connection_dict('database'))
 
         elif connection_type == 'oracle':
