fix a few inadvertant bugs