Enable compiler warnings and fix resulting errors