fix indifferent access problem and update tests