Fix order of argument check