Test if length is less than 1, otherwise append last element