fix some bugs in ExpressionController
Add some tests