Fixed exception handling bug.