Fix to exception throwing in data parsing