Fix #89 #179
Fixes #89. Safely monkey patches
This is a nasty bug and deserves this solution right now even if a better one can be developed at a later time. If any help is needed maintaining this library I am very willing as this is an important plugin for my applications.