merge a few more bug fixes