Lua bugfixes in getCustomFunction/setCustomFunction and
getLogicalSwitch/setLogicalSwitch