Removed unnecessary checks
Fixed compilation warnings