Fix NPE on "openall" and "closeall" gate commands