Changed the write mode of the files (rewrite)
Solved some issues when creating at_ej3.stb.
First fully working version of teh script. :)