@inheritparams tag: fixed bugs and improved unit test

Deep clone of parameters ensures that original parameters aren't changed.
Template now displays 'attributes' in parameters if they are only inherited
and not also optional (etc). Fixed mistake in unit test, and expanded.
Tests all green.