Bugfixing dry coded changes from the last three commits