Fixed main configuration so that not all functions make the main script quit