Minecraft animals going through blocks?

I thought they had fixed this bug in 1.6.2? My sheep are still going through blocks and I can't keep them separated by colour? It's bothering me a lot because they either get into the incorrect pens or they end up in the hallway and I have to round them up again.
I'm playing version 1.7.4.

Also, a grammar check; are the sheep "fazing" through the walls or "phasing?"

Added (1). It is not when the chunk is unloaded. I have stayed in my house the entire time, and my farm is connected to my house. I just ran downstairs to get the other sheep and when I came out one of them was out yet again.

Sheep will glitch through the blocks if there are too many in one small area, if the pens are like 2x2 and you have 10 sheep in there one of them is bound to phase through. So if you have too many sheep in a small space then that's why it keeps happening.