Fix various things

See commits.

How many issues can be closed with one PR?