fix: remove negative weights and 0-length strings