Fix various little problems

See commit messages