Add missing parentheses and derivative index. Mosts tests now pass.