Fix bug with propagating type in function patterns