Fix #659, prefer local types and patterns