Bug Fixes

Fixes #38
Fixes #39