Scripts/Misc: Small code optimizations