More gate fixes/improvements