Scripts/ToC: Few codestyle changes and clean ups

(cherry picked from commit f6896c9a3a460047b47190d2964d73029bf33eb1)