Fix bug in open command