fixed a bunch of bugs in dpmeans