Add some failsafes