Revert "Bug fixes"

This reverts commit 621a6b746496e6dbb9956ef86ceeea91fd248867.
Bug fixes

Fixes #1