Minor cleanup/fixes to the core.

Just a few tiny minor cleanups.