fix dealocation and price < 0 in mask reconstruction