fixed three warnings / errors from the gfortran compiler about undefined behavior when aggressive loop vectorization is used by the compiler