Fix error in stack.py: was never tested in a production server.