fixed bug in conversion of real values to integer lattice elements