Removed dead code. General tidying.