wip: bug fixes