Fixed all compile warnings & errors