bug fixes to run with simenv