Fixed a few issues to close #97.