Fixed logic bug in log parsing