Minor fixes and follow up on Kacper's refactoring.