correct minor bugs in engine, expression function and some classes of package apps