Fixed bug that causes duplicate temporary variables