fix broken handling of empty bodies