Cleanup header and other small improvements