Fixing bugs found in qa