Fix compiler warnings and enable errors for future warnings