Fixes to work with new environment