Fix issues #6 #7 #8 Text files should end with a newline character

Fix #6 
Fix #7 
Fix #8