Added preliminary logging and updated ChangeLog. Also added some exception handling.