Minor cleanups, add comments