Fixed tonne of bugs