fix a bug or two