int32 primary keys, mysql fixes, cleanup