Fixing bugs for upgrading to production level