Re-merge a few changes

* Re-merged some previous changes. I still have to learn how to use git
properly :(