Various loader and apier fixes