closes #544 closes #513