Corrected memory leak in saveexposure-test.
Improved Lua detection and linkage.