Better error message when service names are invalid

Closes #261.