Added logging capability.
Corrected two minor bugs in logger (typos)