Fix push_ref() that forgot to push nil when the ref is empty.
Remove useless variable.