Fixed compilation warnings & errors