Slightly more defensive programming