Bugfix: finding extension of filename.