Fixed #838 System crashes when publishing