Fix undefined var
Small fixes + add quota
Merging changes from upstream + small fix