Exercise 2.92: Fix treatment on different types