lots of bug fixes...