Couple of bug fixes and small changes