Added match for a fatal error. Also rearranged the code a bit to make it more readable.