I think there's a bug here that prevents executing the last command in the history. Also, can you please add some parens or otherwise make this easier to read?