type: Fix the regexp to match from start.
tests: Fix tests for Ruby 1.8.7, Puppet < 3.2.