Custard curdling/splitting
It sounds like your custard was overcooked, causing the proteins to break down. This can easily happen when you make custard in a pan. By the time you realize it's happening it's too late. Try using a double boiler instead, or improvise one using a pot with water and a bowl. 

Also, don't cook it too long, it should still be somewhat runny when hot. If you cook until it gets really thick that's too long, cook it only long enough that you see a change in consistency.

If it does start to curdle pour it out into something else right away, and use a stick blender on it, that may save it.  

Here's a good page that gives examples of typical custard problems and how to avoid them.