Some medi fixes in core js