Fix feature generation bug