(Re)apply changes from pull request 870 (actually) to source
Build distribution for testing purposes