Slightly better pattern matching, still broken.