fix for bug586

Morgan, fixed the relevant assertion. --Kshitij