Final fixes. Closes #21