Adding environments and fixing direct search