Make small improvements to internals