Bug squashing

Fixed bugs in the framework