When I run your script, I get a correct max open margin both ways. However I used the IB assets. Maybe something is wrong in your asset list?