another couple of bug fixes