Minor cleanups of functions.