Fixed error in reference parsing