Some bugs sorted