more bug fixes (hopefully?)