Fix and improve packedarray (#915)