Small fixes to increase resilience