small fixes, added compiler barrier