Added some slightly more defensive blocks.