a few more error case fixes