A bit of misc fixes