Silence smartmatch warnings and fix a test for latest Mojolicious

Hi Koorchik,

Please consider merging in my pull request, it fixes some spurious warnings and makes the tests pass with all versions of Mojolicious.

Thanks.