Fix NPE and change default format.