Fix argument order so ctx is always first