fix lot's of old bugs