Remove debug errors, fix a couple compile warnings