fix for fluky problem 'argument out of range'
Merge pull request #739 from ifilippov/fluky

Fix for fluky problem 'argument out of range'