remove some dangling bits