Add more descriptive error message for invalid string specification