Various small changes and fixes