Fixed some errors in checking if barriers are enabled