Fixed some tests and made some cosmetic changes