Check stats object to be null to avoid NPE
Re-enabling the auto format on save option