Sets correct (original) length after Array::sort. Fixes #146