Fixes and minor improvements

Another bunch of minor fixes...