fixing #33
Backported fix for #33