I think the 'extendEmpty' function is not needed.

It is necessary to do 'extend' also of the object of an argument.