Make entity_decode() handle invalid input better.