Fixes for travis build, re-refactor of get_both_filenames and added test case