Fix for crash in test sample