Core/Scripting: Some cleanup