Another bunch of fixes and minor changes