Added code to determine default preferences from file extension