Some improvements and unit testing on /test