improve error reporting on malformed labels