Bug fixes.

Fix test failure in MSVC builds and gcc optimised builds due to dangling
reference from state accessor/mutator.

Note clang test failures in readme.