See gist #330318.