fixed sorting in place plus numpy arrays