Better logging and some minor test fixes + time stats