Fix compile with MSVC (issue #199)

And use a macro to make type initialization shorter.