Updated to 1) fix bug in Main that created NPE. 2) have app look for last "." in file name rather than first.