Definitely a nematode. Planaria are shaped like a fat arrow, and are very flat. They are harmless and fish usually enjoy eating them, so don't take any risky moves to kill them. I get the 'yuck' and 'ugly' views, but these worms are best dealt with, as mentioned, by light feeding. Some worms will always be present, but you'll probably never notice them.