Fixing `wait` method, because it wasn't supporting multiline response (attempt 3).