Couple of bugs fixed