Fixes #79 - use gsub to strip trailing character(s)