Bugs fixed
Fixed coding styles