A couple of bugs fixed