Minor fix with friendly static assert and better compatibility, especially for MSVC.