Added handling for numerical sorting to initSort