Clean up the top of the upgrade file a little.
Fix default milestone ID query.
Added helper to fix database rows belonging to deleted users.