Latest round of bug fixes