do not consider indexing unsafe - reference will live safely in a container in most cases
reduce impact of 'unsafe C derivative' error to pointers and fix conditional expressions