fixed a couple exits on error conditions