Fix bug in open.