Fix regex to also allow trailing space
Add missing -d argument