Add test and fix code
Fix test