Replace ULONG_MAX usage with numeric_limits<uint32_t>::max() to avoid a compilation warning.
Compilation warning fixes.
Fix a crash where the custom handler was used even though a) we parsed a known message, and b) no custom handlers were installed.