Bunch more bug fixes.