Fixed bug that copied functions and not values