fix bugs and update tests