Revert "Another fixes for #1670"

This reverts commit 0731d15d53ee5725e867b73a03636e98d3d2ce74.
Revert "Fixes #1670"

This reverts commit a5feff807d13dd18423583416be19342979c0dbf.