Added a Logger and some minor changes.