A handful of cleanup work and some minor bug fixes