Add test and other small changes