various environment, testing fixes