Minimal fix for getCode() returning null after 1st invocation