Excel export: added a check to reduce the number of occurences of JSONExceptions being thrown.