Added logger, improved tests