Various updates

Some updates and fixes I made a few months ago. I don't remember exactly what those are, but here they are.