more optional ref tesst

this breaks on msvc, but that only reveals the problems that were there anyway.