Test exception cases