Better error handling when parsing text DB files. Minor code improvements.