Adding tests. Fix #136