Added logging and various miscellania.