Fixed 'pointer being freed was not allocated' .