Revert "Various bug fixes, levelling"

This reverts commit 1ec6e29677076cb7be1784efd94f66f83e26b98f.