Various cleanup and enhancement changes