Fixes from review by @Hoikas