Fixes for a few compiler warnings and errors