Fixed MEM portfolio error