Fixed spec env; Fixed most broken tests