Cleanup: Catch pattern match failure earlier.