all sorts of bug fixes