Fix illegal memory access in FE calculations