Updated extension detection in generator_utils.lua