Incorrectly checking path ends without slash rather than ends with.