Fix compatibility with gen1 and gen2