Added runtime error handling.