Misc code changes