Closes #536