Missing mode parameter in open()

Thanks to Kristen Webb for finding this bug.