Revert "Merge pull request #482 from hultqvist/upstream"

This reverts commit a92f13c21d9ada53cb41ecf60395249ac0d5c783, reversing
changes made to 077abd6034a85a61f8c88233fdda4282cbb3fcaa.