Fix testSum function in example code