Fixed a bug when using cmd+P or cmd+T for open files