Fixed a bug that caused an error when switching to a new program from an empty program stage