More defensive in terms of error handling.