Bugfix: sorting takes care of various undefined values.