Corrected for a MSVC compiler bug and more tests in validate()