A collection of misc fixes