Closes #339