fix a few problems