Fixed all compilation error. To fix barriers