Closes #542