Additional changes to fix breakage when tested with tingping's testcase