Finalising bugfix

Tested and working