Improvements to react.py