Merging bugfixes from chocolate-doom/master