Couple of bug fixes and a minor performance improvement.