quite a few fixes to the quota system, cleanups etc.