fix shorten tests and guard regex