Some classes added and bugs fixed