Fixing bugs in core class