Fix syntax error when service has no types

There was an error within the string handling, since strrpos evaluates to false, and false is interpreted by substr as a length of 0.

Fixes #162