fixed a couple typos and bugs
added some logging messages