Reverted previous patch as it needlessly invalidates cache on program
reload. Added explicit protection against lambda funcs.