bugfixes found when building on NeSI