Fix possible runtime error in multi-part method calls