Core/Scripting: Misc clean up and a warning fix