Sync to poifox's master branch