Add more tests for reference edge cases