Fix for-loops to run on strings

Closes #478
Closes #479