Had to change typename to class in template declaration of ref.hpp