Fixed checkAllowance method.