Ignore empty strings after splitting on '_'.

Fixes #1006.