Fixed a bug where temporary input variables were not being deleted property
Added some test helpers to ensure proper cleanup

Signed-off-by: Richard Minerich <richard.minerich@gmail.com>