fixes to bed generation