A bunch of bugs fixed.