fixed small compilation warnings and a small bug