Why They Bite
No one likes being nipped by their dog but their intentions are not always bad as they may simply be playing. Sometimes we forget they are actually animals. Thus, dogs bite each other when they play and it is not always in an aggressive way. Just to be on the safe side, keep an eye out for signs of aggression or fear.
Sleeping Beside You
This is back to the pack behavior as dogs inherited this need for close contact and comfort. They hunted in packs and behaved in packs thus, it is only natural that they want to sleep near you for security and warmth. You should feel flattered that they trust you enough to act this way.