Closes #565