with splitext fix per markv code review