Couple of random bug fixes