Bug fixes (addressing a handful of issues)

Trying to address #58, handful of other small things like adding tests.