Fixing some bugs

Fixes #63, Fixes #62