Some fixes in global fun