Take fix from changeset:26888e1 by @pixelogik related to #144