Match with or without ruby prefix
Fix auto-switch function