io: Fix potentional memory leak
io: Fix typos in code