I believe this version of the patch solves the frei0r issue. Could you have a look, do modifications if you see fit. This is very much based on your patch. WDYT?