The rules on the wiki don't take into account a possible bug in 1.5. The tests done in
[http://gaming.stackexchange.com/questions/20567/how-to-construct-a-safe-sleeping-area-in-1-5-version][1] suggest that the amount of flat space in front of and/or behind the door you use could be the culprit. Making sure there were 4 blocks both in front of and behind my doors did fix the problem in one of my bases, although there appear to be other circumstances that also work.


  [1]: http://gaming.stackexchange.com/questions/20567/how-to-construct-a-safe-sleeping-area-in-1-5-version