Fix lots of bugs...