Remove redundant loop
Closes #608
Closes #566