Fixed bugs in policygen.py (--max options are now working properly)