Couple of bug fixes