Combine #391, #392 and #393

Fixes CI.