fix a few odd bugs