fix some fatal errors