Updated way flags are managed
Removed unneeded toLowerCase()