fix compilation in three dimensions