Fixed a few undefined variable errors

Somehow I missed a few in tests/test_memory_leak.py when I was
refactoring out `from numpy import *` for `import numpy`. Whoops.