Various cleanups for autofoo