When you flash the stock, do a factory reset. Any if it does not work, repeat the procedure (reset/flash/reset). But make sure you have the right stock (I suggest to take it from sammobile). I heard of up to 7 tries before success...
Samsung Galaxy S4 LTE - OMEGA v13.1, ausdim kernel
Samsung Galaxy S3 - rooted, S4 Revolution 7.0
Samsung Galaxy Tab 10.1 - rooted, Carbon ROM - JB 4.2.2
Xperia Arc S - KTG Kernel - LOVINS PAC ROM
Huawei P1 - rooted, RootBox ROM, JB 4.2.2
Desire HD - rooted, VenomROM - retired to pension/backup phone