rename type_cast to type_cast_from_database

Small fix for issue #168