Importing issue #14 fix from master