fix ident issues and add test case