Fix bug #1
Fix bug #3
Fix bug #2 by only allowing text files