fix ALLOWED_CHARS pattern
add more tests, fix argument processing bugs