Added test for some classes. Fix some bags