fixes a few problems