Fixed and prevented compile warnings