Improved unitttest handling