Add a bit of defensive programming