Minor bug fixes
Test about opening a file for reading and writing