Adds tests and closes #112