Fixed bugs in a few methods