Fix evaluation, add tests