Fix string compare bug and add more complete usage in comments