Fix #25: be more defensive