Added tests, fixed issues