backported issue #386 fix to version 0.10

@onlywade fixed this found and fixed issue #386 in master, this is the fix backported to version 0.10