Fixes

The commit history is very bad, I should probably `rebase -i` before merging ...