Added missing heap check; Removed dangerous vector<char> conversion;