make applicable smob calls cheaper, and fix a memory leak