Fixes #471

It may have some side effect. Seems working fine for me
Merge pull request #535 from magnetik/patch-1

Fixes #471