Various minor fixes all over the place