Fix compiler warnings and errors.