Revert "htomasz's fixes"

This reverts commit a53bd39a36cc4fdfb212ffbd0f9614194d3c2e92.