fix various misc errors/warnings