fix some more bugs