lua: properly handle corner cases in changes