fix and add test for corner case in dependent printing.