I changed that logic users now use the miningkeys.dat file with the required keys for mining.
Can confirm that it works. But it seems that it does not take the keys one by one.
It think is just hopping between the first keys.
Since chainz is behind, I just decoded some blocks by hand.
Also put no comments behind the keys nor between the lines in the miningkey.dat.
Throws out an error: wrong key
lg t.