Logger added. Minor fixes.