Fixed couple of bugs.