Attempting better error handling.