Fixing recursive calls