Add test and fix formatting