Various improvements/cleanups