* Santize environment
* Fix off-by-one bug