Core/Misc: Refactor scripts to fix static analysis warnings
Core/Misc: Refactor scripts to fix static analysis warnings