Added a simple fix in https://github.com/mk-fg/games/commit/d4823b6e - to use entity's surface as you suggested, and loop over these in occasional rescans (which are default-disabled anyway).
Can you check if that fix works - i.e. doesn't crash factorio after a second or two due to some typo - and report back?
Will be able to upload updated version then, as I don't have factorio installed to test it myself.
Easiest way to check is probably grab updated control.lua file from current github (linked above), unpack mod zip to mods directory, replace control.lua file there with downloaded one, remove .zip (though iirc factorio should use unpacked dir over zip ayway).
Thanks for reporting.