Improved code robustness