fix a few more bugs