Various minor changes and fixes