ctapply fixes: correct order and use names properly