EOF bugs solved