Synchronize model objects.
Small sql fixes.