Correctly set i and fsize after substitution, fix crash and code cleanup #2

Merged
SKBotNL merged 5 commits from main into main 2026-04-05 12:31:19 -04:00