Mac compatibility

`expr length` doesn't work on Mac.

Tests changed on Mac and Ubuntu (server)