Misc code clean-up