some fixes in CORTEX script
some cortex tweaks