Bug fixes. Closes #33 and Closes #34