Hotfix - akbar's fix for #864