Log file fix, MasterLogReader fix, test cases

Fixed a bug in logging, MasterLogReader, added more unit tests