Fixes #471

It may have some side effect. Seems working fine for me