oddly, need explicit make $past; return;

It should fall through and do the 'make $past' at the end of the function but doesn't.
(Also, remove a useless line from check_variable.)