fixing problem 644

This patch checked on all Linux targets except avx2.
Regression test will be added later.