Fix "Pattern match(es) are non-exhaustive" warning in "apply" function.