Fixed null condition to ensure that null values get pushed back in the array.

Change-Id: I1d640522f3843c6b0e6178f15f8dbda50cccffdf
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
replacing full array sort with a range sort

Change-Id: Ibe43d4a5e82565589aa51544e2fcc7dfe18cb5d4
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
renamed variable 'minimum' and added explanation as to why it is used.

Change-Id: I384b485682702da90d5c8b068ca13ca0c33e896d
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>