Animals still escape their pens

Solution 1:

This is a bug that still exists in the game. Clearly, I suppose. Point is, your version of Minecraft has nothing to do with it.

I have seen this problem many times, and it seems to be related to fences and reloading the world after it has been unloaded. One solution to your chicken escapee problem could be to dig a two-deep pit for your animals to live in.

Don't they look so happy?

...but there's a problem. When you replace the fences your animals have glitched into with solid blocks, you have some slight suffocation problems (same bug). So that's no good without some slight adjustments.

I tried an old method using water, however, animals are somehow more broken now, and sit at the bottom of the water streams and drown.

So I tried another approach: I used slabs for the bottom layer of wall instead of dirt blocks. They'll still keep your animals inside, even if you relog, and with minimal casualties (occasionally, I'd get a few baby pigs suffocate when I relogged, but nowhere near as consistently as without using slabs.

Saddled pig ranch, no escapees

However, I have found some weird behavior using slabs. You can use any other transparent block, but, since apparently baby pigs are less than a half block tall now, you cannot use slabs. Also, if you wish to contain cows, you will need 2 layers of transparent blocks. I used glowstone in this case.

Updated image

SCIENCE!