Allow square brackets in input name

Also fixes #1 in a more graceful way