small fixes to sample fetching in ReadParameters