Added missing empty check.