Had to refix one bug. Still several to refix...