add more tests, fix standalone file case