Fixed foolish mistake
Added tests