Fix compile warnings, remove unneeded exception handlers