Closes #357
Closes #366 and #357