Fixed bugs in express code