fixing API bug where get_field would not work if the reference field was missing

Signed-off-by: Elliot Condon <e@elliotcondon.com>