Fix string-format type when casting. Closes #25