About Boundary Terms in Higher Order Theories