Fix wrong code generation for vars with imported record type (Issue #15).