Prevent minus signs from being added after non-digits