Add some robustness for issue #16