Batch of updates

A number of fixes and changes. See commit log for details.