Fix for bug that keeps crashing generation