The phrase "sleep tight" originated when mattresses were set upon ropes woven through the bed frame. To remedy sagging ropes, one would use a bed key to tighten them.