Invalid string extraction fix