Fixes #1622: Lua function script not called for SF >= 8
Fixes #1636