got rid of compile warnings + one query corrected