Tags api fixes relating to PR #153

minor fixes to clean up code