Revert changes made in commit de18420 (partly) and a6ff7de