Final round of bug fixes