A round of bug fixes