Fix bug: It was failing when the path is the root path in the URI. Probably a Rails issue.