a few more bug fixes