fix for nested template defined out of class (issue #265)