Some bugs in class