Fixed TODO: logging; exceptions