Various fixes/cleanups.