Added preferred exception handling.