Adds logging, fixes typo