Use make-local-variable instead of defvar-local to pass tests