Fix some bugs in evaluation