Fix several bugs: openning file, wrapping long line