Added zero length check, comment