Fixed use of code referencing temporary objects.