Improved direct reference parsing, refined test.