Bug fixes to recursive calls