Fixed bugs with logging, added getLog()