Rebase to master

Just a heads up, because I wanted to dig into your code a bit more but wanted to rebase to master first. So I already patched up the merge conflicts ;)