Fixed patcher problem

Fixes the problem with the patcher. 
Not tested, but from code review it should be clear what did go wrong.