ped_to_bed bugfixes