Revision to previous commit

Calling ElementArrayOrDefault to make sure that we have something at
the zero index and wrapping it all in a try-catch.