Add some sanity checks to resources iteration routine in PE module