Fixed illegal memory access on corrupt input data, now throws exception string