Fix invalid open() usage