reprojects x, y, z for empty readings

note that we also starts in i=j=0, instead of i=j=1
(the last 2 rows were ignored)
fixes minor compilation warnings and cosmetics