Improving robustness; lots of work needed here :(