Fix couple of bugs.