Fail gracefully when Mongo unavailable

This fixes issue #299