couple of bug fixes